﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CLEX.AdminUI.Service;

namespace CLEX.AdminUI.ViewModel
{
    internal sealed class SharedDatabaseReadVM : ViewModelBase
    {
        private readonly SharedDatabaseData sharedDatabase;
        private readonly string ownerUsername;
        private readonly string sharedWithUsername;
        private readonly string databaseName;
        private readonly string connectionString;

        public string OwnerUsername
        {
            get { return ownerUsername; }
        }

        public string SharedWithUsername
        {
            get { return sharedWithUsername; }
        } 

        public string DatabaseName
        {
            get { return databaseName; }
        }

        public string ConnectionString
        {
            get { return connectionString; }
        } 

        public int DatabaseId
        {
            get { return sharedDatabase.DatabaseId; }
        }

        public int SharedUserId
        {
            get { return sharedDatabase.SharedUserId; }
        }

        public SharedDatabaseReadVM(SharedDatabaseData sharedDatabase, string ownerUsername, string sharedWithUsername, string databaseName, string connectionString)
        {
            this.sharedDatabase = sharedDatabase;
            this.ownerUsername = ownerUsername;
            this.sharedWithUsername = sharedWithUsername;
            this.databaseName = databaseName;
            this.connectionString = connectionString;
        }

        public SharedDatabaseData GetData()
        {
            return sharedDatabase;
        }
    }
}
